import request from '@/router/axios';

export const getSchoolTree = params => {
  return request({
    url: '/api/PcPublicService/GetSchoolTreeSelect',
    method: 'get',
    params
  })
}

// 心理问卷列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/ManagePsychicQuest/GetPsychicQuestList',
    method: 'get',
    params:{
      ...params,
      current,
      size,
    }
  })
}

// 心理问卷详情
export const getDetail = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/GetPsychicInfo',
    method: 'get',
    params
  })
}
// 心理问卷模板
export const getTemplate = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/GetPsychicTempList',
    method: 'get',
    params
  })
}
// 获取模板详情
export const getTemplateDetail = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/GetPsychicTempInfo',
    method: 'get',
    params
  })
}
// 获取调查范围
export const getSurveyRange = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/GetFieldScopeList',
    method: 'get',
    params
  })
}
// 添加修改问卷
export const addOrUpdatePsyTemp = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/AddOrEditPsychicQuest',
    method: 'post',
    data: params
  })
}
// 发布撤回问卷
export const publishOrCancelPsyTemp = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/IssueOrCancelPsychicQuest',
    method: 'post',
    data: params
  })
}
// 复制心理问卷
export const copyPsyTemp = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/CopyPsychicQuest',
    method: 'get',
    params
  })
}
// 预览心理问卷
export const previewPsyTemp = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/PreviewPsychicQuest',
    method: 'get',
    params
  })
}
// 删除
export const deletePsyTemp = (params) => {
  return request({
    url: '/api/ManagePsychicQuest/DelPsychicQuest',
    method: 'post',
    data: params
  })
}

// 批量生成数据
export const generateData = (params) => {
  return request({
    url: '/api/ManageQuestTemplate/createScaleResult',
    method: 'get',
    params
  })
}
